package com.ly.lw.styledo.fragment;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.ly.lw.styledo.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class CategorySecondShopFragment extends Fragment {

    @ViewInject(R.id.category_second_shop_text)
    private TextView shopText;

    private String prdDesc;

    public CategorySecondShopFragment() {
        // Required empty public constructor
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            prdDesc = getArguments().getString("prdDesc");
        }
    }


    public static CategorySecondShopFragment newInstance(String prdDesc) {
        CategorySecondShopFragment fragment = new CategorySecondShopFragment();
        Bundle args = new Bundle();
        args.putString("prdDesc", prdDesc);
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_category_second_shop, container, false);
        ViewUtils.inject(this, view);

        initData();
        return view;
    }

    private void initData() {
        shopText.setText(prdDesc);
    }


}
